﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NGUYENTHANHDONG.Excercise.Bai4
{
    class MODELS
    {

        public double TinhNgay(UserEntity objUser)
        {
            double temp1 = 0, temp2 = 0;

            if (objUser.NAM % 4 == 0 && objUser.NAM % 100 != 0)
            {
                if (objUser.THANG == 2)
                {
                    temp2 = 28;
                }
  
            }
            else
            {
                if (objUser.THANG == 2)
                {
                    temp2 = 29;
                }
            }

           
                if (objUser.THANG == 4 || objUser.THANG == 6 || objUser.THANG == 9 || objUser.THANG == 11)
                {
                    temp2 = 30;
                }
                else if (objUser.THANG == 1 || objUser.THANG == 3 || objUser.THANG == 5 || objUser.THANG == 7 || objUser.THANG == 8 || objUser.THANG == 10 || objUser.THANG == 12)
                {
                    temp2 = 31;
                }
            
            return temp2;
        }
    }
}
